﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sunboxsoft.ASMS.Client.Domain.WebRef
{
    public partial class MaintenanceBillDetail
    {
        /// <summary>
        /// 是否完成了所有的服务项目
        /// </summary>
        /// <returns></returns>
        public bool IsAllServiceItemFinished()
        {
            if (this.ServiceItemList != null && this.ServiceItemList.Length > 0)
            {
                for (int index = 0; index < this.ServiceItemList.Length; index++)
                {
                    if (this.ServiceItemList[index].ActualFinishedTime == null)
                    {
                        return false;
                    }
                }
            }

            return true;
        }

        /// <summary>
        /// 是否完成了所有的物料出库
        /// </summary>
        /// <returns></returns>
        public bool IsAllMaterialFinished()
        {
            if (this.MaterialList != null && this.MaterialList.Length > 0)
            {
                for (int index = 0; index < this.MaterialList.Length; index++)
                {
                    if (this.MaterialList[index].ActualFinishedTime == null)
                    {
                        return false;
                    }
                }
            }

            return true;
        }
    }
}
